package user;

import book.BookList;
import operation.IOperation;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 王圆豪
 * Date: 2024-05-24
 * Time: 20:20
 */
public abstract  class User {
    private String name;
    protected IOperation[] iOperation;

    public User(String name) {
        this.name = name;
    }

    public abstract int memu();
    public static User login() {
        int choice;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你的姓名：");
        String name = sc.nextLine();
        System.out.println("请输入你的身份：1. 管理员   2. 普通用户");
        choice = sc.nextInt();
        if (choice == 1) {
            return new Admin(name);
        } else {
            return new Reg(name);
        }
    }

    public abstract  void doOperation(int choice, BookList bookList);

}
